<template>
  <div>
    <h2>请选择你喜欢的专栏</h2>
    <!-- 循环数组arr -->
    <span v-for="(item,index) in Arr" :key="index" for="like">
      <!--v-model="like"选中就将值放在like数组里  -->
      <!-- v-bind:value="item"将value值改成item -->
      <input type="checkbox" v-model="like" v-bind:value="item">{{item}}
    </span>
      <ul>
        <!-- 循环，like里面有多少个，就循环几次 -->
        <li v-for="item in like" :key="item">{{item}}</li>
      </ul>
  </div>
</template>

<script>
// 思路：

export default {
    data() {
      return{
        like:[],
        Arr:["科幻","喜剧","动漫","冒险","科技","军事","娱乐","奇闻"]
      }
    }
    
}
</script>

<style lang="scss" scoped>

</style>